Skip to content

feat(lean): add negated condition to while loop spec#1863

Merged
abentkamp merged 1 commit intomainfrom
alex/while
Jan 13, 2026
Merged

feat(lean): add negated condition to while loop spec#1863
abentkamp merged 1 commit intomainfrom
alex/while

Conversation

@abentkamp
Copy link
Copy Markdown
Contributor

@abentkamp abentkamp commented Jan 12, 2026

This PR strengthens the specification Rust_primitives.Hax.while_loop.spec of while loops by specifying that the condition is false after exiting the loop. To do this, we convert the condition into a pure function in the same way that we convert the loop invariant and the termination measure. This is necessary to refer to the condition in the postcondition.

While experimenting with the new feature, I found that using decide to convert Prop to Bool in the specs of greater-than, less-then, etc. makes more sense than the implicit conversion to Prop that was present in those specs previously.

@abentkamp abentkamp added lean Related to the Lean backend or library proof-lib Issues related the backend-specific definitions (in the proof-lib folder) labels Jan 12, 2026
@abentkamp abentkamp added this to the Lean proof library v1.0 milestone Jan 12, 2026
@abentkamp abentkamp requested a review from maximebuyse January 12, 2026 15:45
@abentkamp abentkamp marked this pull request as ready for review January 12, 2026 15:45
@abentkamp abentkamp requested a review from a team as a code owner January 12, 2026 15:45
@abentkamp abentkamp added this pull request to the merge queue Jan 13, 2026
Merged via the queue into main with commit 2d3ca01 Jan 13, 2026
17 of 18 checks passed
@abentkamp abentkamp deleted the alex/while branch January 13, 2026 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lean Related to the Lean backend or library proof-lib Issues related the backend-specific definitions (in the proof-lib folder)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants